home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / ZIPLOG10.ZIP / ZIPLOG.BAS next >
Encoding:
BASIC Source File  |  1996-02-18  |  1.5 KB  |  46 lines

  1. TOP:
  2.    ON ERROR GOTO HANDLER
  3.    PRINT
  4.    COLOR 15: PRINT "ZIPLOG.EXE ";
  5.    COLOR  8: PRINT "- ";
  6.    COLOR 12: PRINT "Version 1.0  ";
  7.    COLOR  9: PRINT "Copyright (c) 1995,96  Ron Whitney (1:236/20.3) "
  8.    COLOR 10
  9.    PRINT
  10.    IF COMMAND$="" THEN GOTO SYNTAX
  11.    NOW$ = DATE$
  12.    TODAY$ = LEFT$(NOW$, 2) + MID$(NOW$, 4, 2) + RIGHT$(NOW$, 2)
  13.    NEWNAME$ = TODAY$ + RIGHT$(COMMAND$,4)
  14.    '  Use the three lines below to COPY oldfile to newfile.
  15.    '     PRINT "Copying ";COMMAND$;" as ";NEWNAME$
  16.    '     ZIP$="COPY " + COMMAND$ + " " + NEWNAME$
  17.    '     SHELL ZIP$
  18.    '  Use the line below instead to REName oldfile to newfile.
  19.    NAME COMMAND$ AS NEWNAME$     ' Does a REName
  20.    PRINT "Zipping up the ";NEWNAME$;" file......"
  21.    ZIP$ = "PKZIP -M " + TODAY$ + " " + NEWNAME$ + " > NUL"
  22.    PRINT LEFT$(ZIP$,LEN(ZIP$)-6)
  23.    SHELL ZIP$
  24.    END
  25.  
  26. SYNTAX:
  27.    PRINT "ZIPLOG will change any file specified to mmddyy.LOG and"
  28.    PRINT "will then invoke PKZIP to archive to mmddyy.ZIP."
  29.    PRINT
  30.    PRINT "Usage:  ZIPLOG filename.ext    where filename.ext is the file to archive."
  31.    PRINT
  32.    END
  33.  
  34. HANDLER:
  35.    SELECT CASE ERR
  36.       CASE 53
  37.      COLOR 15:PRINT "ERROR! - File not found."
  38.      COLOR 10:PRINT "Verify that ";COMMAND$;" exists in the current directory."
  39.      ' Insert other error traps in this CASE statement as needed.
  40.       CASE ELSE
  41.      COLOR 15:PRINT "ERROR! - Unknown error number ";ERR;" has occured."
  42.      COLOR 10:PRINT "Report this error and conditions to Ron."
  43.    END SELECT
  44. END
  45.  
  46.